import { makeAutoObservable } from 'mobx'
import { http } from '../utils'

class ChannelStore {
    channelList = []
    constructor(){
        makeAutoObservable(this)
    }
    //多组件（article,publish）都要调用，写在父组件中(layout)，
    loadChannelStore = async () => {
        const res = await http.get('/channels')
        this.channelList = res.data.channels
      }
}

export default ChannelStore